package xyz.liut.recyclerview;

import android.content.Context;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Liut
 * @ClassName xyz.liut.recyclerview
 * @Description 更加人性化的RvAdapter extends RecyclerView.Adapter
 * @date 2016/6/1
 */
public abstract class RvAdapter<VH extends RecyclerView.ViewHolder, BEAN> extends RecyclerView.Adapter<VH> {

    protected List<BEAN> dataBeans;
    protected Context context;

    public RvAdapter(List<BEAN> dataBeans, Context context) {
        if (dataBeans == null) {
            this.dataBeans = new ArrayList<>();
        } else {
            this.dataBeans = dataBeans;
        }
        this.context = context;
    }

    @Override
    public int getItemCount() {
        return dataBeans.size();
    }

}
